/* --------------------------------------------------------
 * Copyright (c) aeky , Inc.  All rights reserved.
 * --------------------------------------------------------
 */
package com.aeky.strategy.enhance.duck;

import com.aeky.strategy.enhance.flyBehavior.FlyBehavior;
import com.aeky.strategy.enhance.quackBehavior.QuackBehavior;

/**
 * 
 * @author aeky
 */
public abstract class Duck {

    /** 鸭子叫行为 */
    private QuackBehavior quackBehavior;

    /** 鸭子飞行为 */
    private FlyBehavior flyBehavior;

    /**
     * 鸭子叫
     */
    public void performQuack() {
        quackBehavior.quack();
    }

    /**
     * 鸭子飞
     */
    public void performFly() {
        flyBehavior.fly();
    }

    /**
     * 鸭子游泳
     */
    public void swim() {
        System.out.println("swim");
    }

    public QuackBehavior getQuackBehavior() {
        return quackBehavior;
    }

    public void setQuackBehavior(QuackBehavior quackBehavior) {
        this.quackBehavior = quackBehavior;
    }

    public FlyBehavior getFlyBehavior() {
        return flyBehavior;
    }

    public void setFlyBehavior(FlyBehavior flyBehavior) {
        this.flyBehavior = flyBehavior;
    }

}
